﻿#ifndef WIDGET_H
#define WIDGET_H

#include "common/baseeditor.h"
#include "statistics.h"

namespace Ui {
class Widget;
}

class Widget : public BaseEditor
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

    void generateMenu();
    void updateMonths();
    void updatePublishers();
    void updateView();
    void updateDetail(const QString &time);
    void showStatistics();
    void clean();

private slots:
    void on_publisher_currentTextChanged(const QString &publisher);
    void on_rank_valueChanged(int value);
    void on_listView_doubleClicked(const QModelIndex &index);
    void on_btn_rank_clicked();
    void on_month_currentTextChanged(const QString &month);

private:
    Ui::Widget *ui;

    int selectId;
    QString selectMonth;
    QString selectPublisher;
    QStringList publishers;
    QStringListModel *listModel;
};

#endif // WIDGET_H
